Integrand size = 30, antiderivative size = 52 \[ \int \frac {a^2-b^2 \sec ^2(c+d x)}{(a+b \sec (c+d x))^2} \, dx=x-\frac {4 b \text {arctanh}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{\sqrt {a-b} \sqrt {a+b} d} \]
[Out]
Time = 0.15 (sec) , antiderivative size = 52, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.167, Rules used = {4127, 4004, 3916, 2738, 214} \[ \int \frac {a^2-b^2 \sec ^2(c+d x)}{(a+b \sec (c+d x))^2} \, dx=x-\frac {4 b \text {arctanh}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{d \sqrt {a-b} \sqrt {a+b}} \]
[In]
[Out]
Rule 214
Rule 2738
Rule 3916
Rule 4004
Rule 4127
Rubi steps \begin{align*} \text {integral}& = -\int \frac {-a+b \sec (c+d x)}{a+b \sec (c+d x)} \, dx \\ & = x-(2 b) \int \frac {\sec (c+d x)}{a+b \sec (c+d x)} \, dx \\ & = x-2 \int \frac {1}{1+\frac {a \cos (c+d x)}{b}} \, dx \\ & = x-\frac {4 \text {Subst}\left (\int \frac {1}{1+\frac {a}{b}+\left (1-\frac {a}{b}\right ) x^2} \, dx,x,\tan \left (\frac {1}{2} (c+d x)\right )\right )}{d} \\ & = x-\frac {4 b \text {arctanh}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{\sqrt {a-b} \sqrt {a+b} d} \\ \end{align*}
Time = 0.25 (sec) , antiderivative size = 56, normalized size of antiderivative = 1.08 \[ \int \frac {a^2-b^2 \sec ^2(c+d x)}{(a+b \sec (c+d x))^2} \, dx=\frac {c}{d}+x+\frac {4 b \text {arctanh}\left (\frac {(-a+b) \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a^2-b^2}}\right )}{\sqrt {a^2-b^2} d} \]
[In]
[Out]
Time = 0.19 (sec) , antiderivative size = 59, normalized size of antiderivative = 1.13
method | result | size |
derivativedivides | \(\frac {2 \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )-\frac {4 b \,\operatorname {arctanh}\left (\frac {\left (a -b \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{\sqrt {\left (a +b \right ) \left (a -b \right )}}\right )}{\sqrt {\left (a +b \right ) \left (a -b \right )}}}{d}\) | \(59\) |
default | \(\frac {2 \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )-\frac {4 b \,\operatorname {arctanh}\left (\frac {\left (a -b \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{\sqrt {\left (a +b \right ) \left (a -b \right )}}\right )}{\sqrt {\left (a +b \right ) \left (a -b \right )}}}{d}\) | \(59\) |
risch | \(x +\frac {2 b \ln \left ({\mathrm e}^{i \left (d x +c \right )}+\frac {-i a^{2}+i b^{2}+\sqrt {a^{2}-b^{2}}\, b}{a \sqrt {a^{2}-b^{2}}}\right )}{\sqrt {a^{2}-b^{2}}\, d}-\frac {2 b \ln \left ({\mathrm e}^{i \left (d x +c \right )}+\frac {i a^{2}-i b^{2}+\sqrt {a^{2}-b^{2}}\, b}{a \sqrt {a^{2}-b^{2}}}\right )}{\sqrt {a^{2}-b^{2}}\, d}\) | \(141\) |
[In]
[Out]
none
Time = 0.35 (sec) , antiderivative size = 226, normalized size of antiderivative = 4.35 \[ \int \frac {a^2-b^2 \sec ^2(c+d x)}{(a+b \sec (c+d x))^2} \, dx=\left [\frac {{\left (a^{2} - b^{2}\right )} d x + \sqrt {a^{2} - b^{2}} b \log \left (\frac {2 \, a b \cos \left (d x + c\right ) - {\left (a^{2} - 2 \, b^{2}\right )} \cos \left (d x + c\right )^{2} - 2 \, \sqrt {a^{2} - b^{2}} {\left (b \cos \left (d x + c\right ) + a\right )} \sin \left (d x + c\right ) + 2 \, a^{2} - b^{2}}{a^{2} \cos \left (d x + c\right )^{2} + 2 \, a b \cos \left (d x + c\right ) + b^{2}}\right )}{{\left (a^{2} - b^{2}\right )} d}, \frac {{\left (a^{2} - b^{2}\right )} d x - 2 \, \sqrt {-a^{2} + b^{2}} b \arctan \left (-\frac {\sqrt {-a^{2} + b^{2}} {\left (b \cos \left (d x + c\right ) + a\right )}}{{\left (a^{2} - b^{2}\right )} \sin \left (d x + c\right )}\right )}{{\left (a^{2} - b^{2}\right )} d}\right ] \]
[In]
[Out]
\[ \int \frac {a^2-b^2 \sec ^2(c+d x)}{(a+b \sec (c+d x))^2} \, dx=\int \frac {a - b \sec {\left (c + d x \right )}}{a + b \sec {\left (c + d x \right )}}\, dx \]
[In]
[Out]
Exception generated. \[ \int \frac {a^2-b^2 \sec ^2(c+d x)}{(a+b \sec (c+d x))^2} \, dx=\text {Exception raised: ValueError} \]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 235 vs. \(2 (43) = 86\).
Time = 0.30 (sec) , antiderivative size = 235, normalized size of antiderivative = 4.52 \[ \int \frac {a^2-b^2 \sec ^2(c+d x)}{(a+b \sec (c+d x))^2} \, dx=-\frac {\frac {{\left (\sqrt {-a^{2} + b^{2}} {\left (a + b\right )} {\left | a \right |} {\left | -a + b \right |} - {\left (a^{2} - 3 \, a b\right )} \sqrt {-a^{2} + b^{2}} {\left | -a + b \right |}\right )} {\left (\pi \left \lfloor \frac {d x + c}{2 \, \pi } + \frac {1}{2} \right \rfloor + \arctan \left (\frac {\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{\sqrt {-\frac {b + \sqrt {{\left (a + b\right )} {\left (a - b\right )} + b^{2}}}{a - b}}}\right )\right )}}{{\left (a^{2} - 2 \, a b + b^{2}\right )} a^{2} + {\left (a^{2} b - 2 \, a b^{2} + b^{3}\right )} {\left | a \right |}} - \frac {{\left (a^{2} - 3 \, a b + a {\left | a \right |} + b {\left | a \right |}\right )} {\left (\pi \left \lfloor \frac {d x + c}{2 \, \pi } + \frac {1}{2} \right \rfloor + \arctan \left (\frac {\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{\sqrt {-\frac {b - \sqrt {{\left (a + b\right )} {\left (a - b\right )} + b^{2}}}{a - b}}}\right )\right )}}{a^{2} - b {\left | a \right |}}}{d} \]
[In]
[Out]
Time = 16.72 (sec) , antiderivative size = 182, normalized size of antiderivative = 3.50 \[ \int \frac {a^2-b^2 \sec ^2(c+d x)}{(a+b \sec (c+d x))^2} \, dx=x-\frac {4\,b\,\mathrm {atanh}\left (\frac {8\,b^4\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )+a^2\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (a^2-b^2\right )+5\,b^2\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (a^2-b^2\right )-8\,a\,b^3\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )-2\,a\,b\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (a^2-b^2\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\sqrt {a^2-b^2}\,\left (a\,\left (a^2-b^2\right )+b\,\left (a^2-b^2\right )+4\,a\,b^2-2\,a^2\,b-2\,b^3\right )}\right )}{d\,\sqrt {a^2-b^2}} \]
[In]
[Out]